Skip to main content
GET
/
v1
/
agents
/
{agent_id}
/
tasks
Get Agent Tasks
curl --request GET \
  --url https://api.xpander.ai/v1/agents/{agent_id}/tasks \
  --header 'x-api-key: <api-key>'
{
  "items": [
    {
      "id": "<string>",
      "agent_id": "<string>",
      "user_id": "<string>",
      "parent_task_id": "<string>",
      "triggering_agent_id": "<string>",
      "organization_id": "<string>",
      "status": "pending",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "source_node_type": "<string>",
      "result": "<string>",
      "title": "<string>"
    }
  ],
  "total": 123,
  "page": 123,
  "per_page": 123,
  "total_pages": 123
}
Get all task executions for a specific agent with support for filtering by user, status, and parent task relationships. This endpoint is useful for monitoring agent activity and debugging task flows.

Path Parameters

agent_id
string
required
Unique identifier of the agent (UUID format)

Query Parameters

page
integer
default:1
Page number (starting from 1)
per_page
integer
default:20
Items per page (maximum 50)
user_id
string
Filter by user ID who created the task
parent_task_id
string
Filter by parent task ID (for sub-tasks)
triggering_agent_id
string
Filter by triggering agent ID (parent calling agent in multi-agent workflows)
status
string
Filter by task execution status: pending, running, completed, failed, cancelled
internal_status
string
Filter by internal task status (for debugging)

Response

items
array
Array of task objects
total
integer
Total number of tasks for this agent
page
integer
Current page number
per_page
integer
Number of items per page
total_pages
integer
Total number of pages available

Example Requests

List all tasks for an agent

curl -X GET -H "x-api-key: YOUR_API_KEY" \
  "https://api.xpander.ai/v1/agents/38551c1d-a16b-454f-84d4-68f431ba608b/tasks?page=1&per_page=2"

Filter by status

curl -X GET -H "x-api-key: YOUR_API_KEY" \
  "https://api.xpander.ai/v1/agents/38551c1d-a16b-454f-84d4-68f431ba608b/tasks?status=completed&page=1&per_page=10"

Filter by user

curl -X GET -H "x-api-key: YOUR_API_KEY" \
  "https://api.xpander.ai/v1/agents/38551c1d-a16b-454f-84d4-68f431ba608b/tasks?user_id=user-123&page=1&per_page=10"

Example Response

{
  "items": [
    {
      "id": "b7e398b2-cddc-4c1e-b714-8200953b8558",
      "agent_id": "38551c1d-a16b-454f-84d4-68f431ba608b",
      "user_id": null,
      "parent_task_id": null,
      "triggering_agent_id": null,
      "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
      "status": "completed",
      "created_at": "2025-11-06T06:05:43.071572Z",
      "updated_at": "2025-11-06T06:05:48.492501Z",
      "source_node_type": "sdk",
      "result": "Your request to \"Test async invoke\" is noted...",
      "title": "Test async invoke"
    },
    {
      "id": "4921b718-7f97-4bc3-8910-1baab59839d9",
      "agent_id": "38551c1d-a16b-454f-84d4-68f431ba608b",
      "user_id": null,
      "parent_task_id": null,
      "triggering_agent_id": null,
      "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
      "status": "completed",
      "created_at": "2025-11-06T06:05:28.666491Z",
      "updated_at": "2025-11-06T06:05:34.055349Z",
      "source_node_type": "sdk",
      "result": "Your request to \"Test sync invoke\" has been received...",
      "title": "Test sync invoke"
    }
  ],
  "total": 8,
  "page": 1,
  "per_page": 2,
  "total_pages": 4
}

Use Cases

  • Monitor agent activity - Track all tasks executed by a specific agent
  • Debug workflows - Filter by parent_task_id to see sub-task hierarchies
  • User analytics - Filter by user_id to see tasks from specific users
  • Multi-agent debugging - Use triggering_agent_id to trace agent-to-agent delegations

See Also

  • [List Tasks](/API reference/v1/tasks/list-tasks) - List all tasks across all agents
  • [Get Task](/API reference/v1/tasks/get-task) - Get detailed information about a specific task
  • [Invoke Agent](/API reference/v1/agents/invoke-async) - Create new tasks

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

agent_id
string
required

Query Parameters

page
integer
default:1

Page number (starting from 1)

Required range: x >= 1
per_page
integer
default:20

Items per page (max 50)

Required range: 1 <= x <= 50
user_id
string

Filter by user ID

parent_task_id
string

Filter by parent task ID

triggering_agent_id
string

Filter by triggering agent ID (parent calling agent)

status
enum<string>

Filter by task execution status

Available options:
pending,
executing,
paused,
error,
failed,
completed,
stopped
internal_status
string

Filter by internal task status

Response

Successful Response

items
TasksListItem · object[]
required
total
integer
required
page
integer
required
per_page
integer
required
total_pages
integer
required